<%-- 
    Document   : dd
    Created on : Nov 13, 2010, 11:45:28 AM
    Author     : M Bilal
--%>

<%@page import="java.util.Iterator"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@ page import="net.sourceforge.wurfl.core.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Device Detail</title>
    </head>
    <body>
        <div align="left" style="padding:2px;">
            <%
                        String ua = "";
                        try {
                            ua = request.getParameter("ua");
                        } catch (Exception ex) {
                            ua = "";
                        }
                        if (ua == null || ua.length() < 2) {
                            ua = request.getHeader("User-Agent");

                        }
                        try {
                        	WURFLHolder wurflHolder = (WURFLHolder) getServletContext().getAttribute("net.sourceforge.wurfl.core.WURFLHolder");
                        	WURFLManager wurfl = wurflHolder.getWURFLManager();
                        	Device device = wurfl.getDeviceForRequest(request);

                            Map l_group = device.getCapabilities();
                            Iterator it = l_group.keySet().iterator();                            
                            while(it.hasNext()) {
                                String key = (String)it.next();
                                out.println("&nbsp;["+key+"="+l_group.get(key)+"<br/>");
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
            %>
        </div>
        
    </body>
</html>
